package com.tpolteam.tpol.tpol2019;

import android.content.Context;

import com.bumptech.glide.Glide;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.module.AppGlideModule;
import com.bumptech.glide.module.LibraryGlideModule;
import com.tpolteam.tpol.tpolcore.CoreApplication;

import java.io.InputStream;

import androidx.multidex.MultiDex;

/**
 *
 */
public class MyApplication extends CoreApplication {


    @GlideModule
    public final class MyAppGlideModule extends AppGlideModule {
    }

    @GlideModule
    public final class OkHttpLibraryGlideModule extends LibraryGlideModule {
        @Override
        public void registerComponents(Context context, Glide glide, Registry registry) {
            registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory());
        }
    }

    @Override
    public void onCreate() {


        super.onCreate();
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(base);
    }


}
